//
//  AdvertisingBigImageCell.m
//  WanCaiC8
//
//  Created by tangang on 2018/5/7.
//  Copyright © 2018年 tangang. All rights reserved.
//

#import "AdvertisingBigImageCell.h"

@implementation AdvertisingBigImageCell{
    QXLable     *labTitle;
    UIImageView *imageV;
}
- (instancetype)initWithFrame:(CGRect)frame{
    if (self=[super initWithFrame:frame]) {
        labTitle=[[QXLable alloc]initTitle];
        labTitle.numberOfLines=0;
        
        [self.contentView addSubview:labTitle];
        [labTitle mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.contentView).with.offset(11);
            make.left.equalTo(self.contentView).with.offset(10);
            make.right.equalTo(self.contentView).with.offset(-17);
        }];
        
        imageV=[[UIImageView alloc]init];
        [self.contentView addSubview:imageV];
        [imageV mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.equalTo(self.contentView);
            make.top.equalTo(labTitle.mas_bottom).with.offset(10);
            make.height.mas_equalTo(@((SCREEN_WIDTH-22)/394.0*160));
        }];
    }
    return self;
}

- (void)setModel:(AdvertisingModel *)model{
//    labTitle.text=model.Title;
//    [labTitle setSpace:5];
    if ([model.Title containsString:@"【"]) {
        labTitle.attributedText = [NSAttributedString tg_imageTextWithTitle:model.Title];
        
    } else {
        labTitle.text=model.Title;
        
    }
    if (model.ThumbList.count>0) {
        [imageV sd_setImageWithURL:[NSURL URLWithString:model.ThumbList[0]] placeholderImage:[UIImage imageNamed:@"big_loding"]];
    }
    
}

@end
